<template>
  <div class="gallery" @click="$emit('hide-gall')">
    <div class="wrapper">
      <swiper :options="swiperOption">
          <swiper-slide  v-for="item of gallery" :key="item.id">
            <img :src="item">
          </swiper-slide>
          <div class="swiper-pagination"  slot="pagination"></div>
        </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Gallery',
  props: {
    gallery: Array
  },
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination',
          type: 'fraction'
        },
        observer: true,
        observeParents: true
      }
    }
  }
}
</script>

<style lang="stylus" scoped="scoped">
  .wrapper >>> .swiper-container
    overflow inherit
  .gallery
    position absolute
    top 0
    left 0
    right 0
    bottom 0
    display flex
    background #000000
    flex-direction column
    justify-content center
    z-index 3
    .wrapper
      width 100%
      img
        flex 1
        width 100%
      .swiper-pagination
        color #FFFFFF
        bottom -1.8rem
</style>
